* {
    margin: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    image-rendering: -webkit-optimize-contrast;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 2) База типографики */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Noto Sans",
        "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: #111827;
    /* slate-900 */
    background: #f5f6fa;
    font-size: 13px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Базовый размер и лёгкая адаптивность заголовков */
h1,
h2,
h3,
h4,
h5,
h6 {}

h1 {}

h2 {}

h3 {}

h4 {}

h5 {}

h6 {}

p {}

/* Вертикальный ритм для типовых блоков */
:where(p, ul, ol, dl, blockquote, pre, table, figure) {
    margin-block: 0;
}

:where(p + p) {
    margin-top: 0;
}

small {
    font-size: 0.875rem;
    color: #4b5563;
}

.lead {
    font-size: clamp(18px, 1.2vw, 20px);
    color: #374151;
}

/* 3) Контейнеры ширины и колонка текста */
.container {
    width: min(100% - 32px, 1280px);
    margin-inline: auto;
}

.prose {
    max-width: 72ch;
}

.flow>*+* {
    margin-top: 1rem;
}

/* 4) Ссылки */
a {
    color: rgb(0, 0, 0);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {}

a:focus-visible {}

/* 5) Списки */
ul,
ol {}

li {}

/* 6) Цитаты */
blockquote {
    border-left: 4px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

blockquote :where(p + p) {
    margin-top: 0.5rem;
}

/* 7) Код */
code,
kbd,
samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
        monospace;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 0.125em 0.375em;
    font-size: 0.95em;
}

pre {
    background: #f5f7fb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    overflow: auto;
}

pre code {
    background: transparent;
    padding: 0;
}

/* 8) Горизонтальная линия */
hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 2rem 0;
}

/* 9) Медиа */
figure {
    margin: 1.2rem 0;
}

figcaption {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.5rem;
}

/* 10) Таблицы контента */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

caption {
    caption-side: bottom;
    font-size: 0.875rem;
    color: #6b7280;
    padding-top: 0.5rem;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
}

thead th {
    border-bottom-width: 2px;
    font-weight: 600;
    color: #0f172a;
}

tbody tr:hover {
    background: #f9fafb;
}

/* 11) Формы */
label {
    display: inline-block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: #111827;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
textarea,
select,
.input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

input:focus,
textarea:focus,
select:focus,
.input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

/* чекбоксы / радио базово, без кастома */
input[type="checkbox"],
input[type="radio"] {
    width: 1rem;
    height: 1rem;
}

/* 12) Кнопки */
button,
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid #1d4ed8;
    background: #1d4ed8;
    color: #fff;
    padding: 0.625rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.06s ease, filter 0.2s ease, box-shadow 0.2s ease,
        background 0.2s ease, border-color 0.2s ease;
}

button:hover,
.btn:hover {
    filter: brightness(1.03);
}

button:active,
.btn:active {
    transform: translateY(1px);
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Варианты */
.btn-outline {
    background: #fff;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.btn-muted {
    background: #111827;
    border-color: #111827;
}

/* 13) Утилиты отступов (минимум) */
.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

/* 14) Адаптивная типографика на малых экранах */
@media (max-width: 480px) {
    body {
        line-height: 1.7;
    }

    h1 {
        font-size: clamp(26px, 7vw, 34px);
    }

    h2 {
        font-size: clamp(22px, 5.8vw, 28px);
    }

    .container {
        width: min(100% - 24px, 1280px);
    }
}

/* 15) Печать (минимально) */
@media print {
    a {
        text-decoration: none;
        color: inherit;
    }

    pre {
        white-space: pre-wrap;
    }

    .container {
        width: 100%;
    }
}

/* BUTTONS */
.dk-btn,
.l-section-cat-btn {
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 8px 12px;
    /* md */
    min-height: 36px;
    min-width: 36px;

    border: 1px solid #e6eaf2;
    border-radius: 12px;
    background-color: transparent;
    /* прозрачная по умолчанию */
    color: #0f172a;

    font: 500 14px/1.1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;

    /* плавный и вход, и выход */
    transition:
        background-color .24s cubic-bezier(.4, 0, .2, 1),
        border-color .24s cubic-bezier(.4, 0, .2, 1),
        box-shadow .24s cubic-bezier(.4, 0, .2, 1),
        transform .06s ease;

    box-shadow:
        0 1px 0 rgba(2, 6, 23, 0.06),
        0 2px 6px rgba(2, 6, 23, 0.04);
}

/* Hover — насыщеннее и заметнее */
.dk-btn:hover,
.l-section-cat-btn:hover,
.dk-btn--ghost:hover,
.l-section-cat-btn--ghost:hover {
    background-color: #eaf4ff;
    /* чуть насыщеннее, с лёгким фирменным оттенком */
    border-color: #cfe3fb;
}

.dk-btn:active,
.l-section-cat-btn:active {
    transform: translateY(1px) scale(0.99);
}

/* Focus */
.dk-btn:focus-visible,
.l-section-cat-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(36, 147, 233, .22),
        inset 0 0 0 1.5px #2493e9;
}

/* Disabled */
.dk-btn:disabled,
.l-section-cat-btn:disabled,
.dk-btn[aria-disabled="true"],
.l-section-cat-btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* Иконки */
.dk-btn i,
.dk-btn svg,
.l-section-cat-btn i,
.l-section-cat-btn svg {
    font-size: 1em;
    line-height: 0;
    flex: 0 0 auto;
}

/* Размеры */
.dk-btn--sm,
.l-section-cat-btn--sm {
    padding: 6px 10px;
    min-height: 32px;
    font-size: 13px;
}

.dk-btn--lg,
.l-section-cat-btn--lg {
    padding: 10px 16px;
    min-height: 40px;
    font-size: 15px;
}

/* Варианты — прозрачны в покое */
.dk-btn--ghost,
.l-section-cat-btn--ghost {
    background-color: transparent;
    border-color: #d9e2f2;
    box-shadow: none;
}

/* Акцентный */
.dk-btn--primary {
    background-color: #2493e9;
    border-color: #1e83ce;
    color: #fff;
    box-shadow:
        0 1px 0 rgba(2, 6, 23, 0.06),
        0 4px 14px rgba(36, 147, 233, .28);
}

.dk-btn--primary:hover {
    background-color: #1f8ce0;
}

.dk-btn--primary:active {
    background-color: #197fcf;
}

.dk-btn--primary:focus-visible {
    box-shadow:
        0 0 0 3px rgba(36, 147, 233, .36),
        inset 0 0 0 1.5px #ffffff;
}

/* Иконка-только */
.dk-btn--icon,
.l-section-cat-btn--icon {
    padding: 8px;
    min-width: 36px;
}

/* Группа */
.dk-btn-group {
    display: inline-flex;
}

.dk-btn-group>.dk-btn:not(:first-child) {
    margin-left: -1px;
}

.dk-btn-group>.dk-btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.dk-btn-group>.dk-btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.dk-btn-group>.dk-btn:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* A11y */
@media (prefers-reduced-motion: reduce) {

    .dk-btn,
    .l-section-cat-btn {
        transition: none;
    }
}

@media (forced-colors: active) {

    .dk-btn,
    .l-section-cat-btn {
        border-color: ButtonText;
        background: Canvas;
        color: ButtonText;
    }

    .dk-btn:focus-visible,
    .l-section-cat-btn:focus-visible {
        outline: 1px solid Highlight;
        box-shadow: none;
    }
}

/*-------------------------------------------------------------------------------------------------*/

/* TOOLTIP */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: 240px;
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 6px 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    /* Расположение над элементом */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    /* Стрелка снизу подсказки */
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/*-------------------------------------------------------------------------------------------------*/

/* PEV */
.item-content img {
    max-width: 100%;
    height: auto;
}

/* Одиночное превью изображения */

.item-content .db-image-preview {
    margin: 24px 0;
    text-align: center; /* чтобы маленькое превью красиво центрировалось */
}

.item-content .db-image-preview img {
    display: inline-block;
    width: min(100%, 380px); /* ширина одиночного превью */
    height: auto;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
    cursor: zoom-in;
    transition:
        transform 0.18s ease-out,
        box-shadow 0.18s ease-out,
        opacity 0.18s ease-out;
}

.item-content .db-image-preview img:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.item-content .db-image-preview figcaption {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #6b7280;
}

/* Отключение зума для служебных картинок */

.item-content img[data-no-zoom="1"] {
    cursor: default;
    box-shadow: none;
}


/* ===== Ряд изображений (несколько рядом) ===== */

.item-content .db-image-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center; /* можно flex-start, если нужно слева */
    margin: 24px 0;
}

.item-content .db-image-row .db-image-preview {
    margin: 0;
    text-align: center;
    flex: 0 1 260px; /* ширина каждого превью в ряду */
}

.item-content .db-image-row .db-image-preview img {
    display: block;
    width: 100%;
    height: auto;
}

/* На маленьких экранах — по одному в ряд */

@media (max-width: 640px) {
    .item-content .db-image-row .db-image-preview {
        flex: 0 1 100%;
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
}


/* ===== Оверлей лайтбокса ===== */

.db-lightbox {
    position: fixed;
    inset: 0;
    padding: 24px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.db-lightbox.is-open {
    display: flex;
    animation: dbLightboxFadeIn 0.18s ease-out;
}

@keyframes dbLightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.db-lightbox__img {
    max-width: min(1200px, 100%);
    max-height: 90vh;
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.7);
    object-fit: contain;
}

/* Блокировка прокрутки страницы, когда открыт лайтбокс */

.db-no-scroll {
    overflow: hidden;
}


/* ===== Кнопка закрытия ===== */

.db-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: #e5e7eb;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.db-lightbox__close:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: #2493e9;
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
}

.db-lightbox__close:active {
    transform: translateY(0);
    box-shadow: none;
}


/* ===== Стрелки навигации в лайтбоксе ===== */

.db-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: #e5e7eb;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
    opacity: 0.9;
}

.db-lightbox__nav--prev {
    left: 16px;
}

.db-lightbox__nav--next {
    right: 16px;
}

.db-lightbox__nav:hover {
    background: rgba(15, 23, 42, 0.98);
    border-color: #2493e9;
    transform: translateY(-50%) translateY(-1px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
    opacity: 1;
}

.db-lightbox__nav:active {
    transform: translateY(-50%);
    box-shadow: none;
}

/* На маленьких экранах — чуть меньше */

@media (max-width: 640px) {
    .db-lightbox__nav {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .db-lightbox__nav--prev {
        left: 8px;
    }

    .db-lightbox__nav--next {
        right: 8px;
    }
}

/*-------------------------------------------------------------------------------------------------*/
